import { getAllMenu, getSongMenu } from "../../service/request/main"
// pages/menuMore/menuMore.js
Page({
  data: {
    allMenu: []
  },
  onLoad() {
    this.fetchAllMenu()
  },
  async fetchAllMenu() {
    const menuList = await getAllMenu()
    const promiseAll = []
    for(const menu of menuList.tags) {
      promiseAll.push(getSongMenu(menu.name))
    }
    Promise.all(promiseAll).then(res => {
      this.setData({allMenu: res})
    })
  }
})